package mk.jug.academy.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;

import mk.jug.academy.model.status.CourseStatus;


/**
 * Domain model representing a {@link Course} in the Java Academy.
 * One {@link Course} can be held by multiple {@link Lecturer}s and can
 * be visited by multiple {@link Student}s.
 * 
 * @author Ice.Penov
 */
@Entity
public class Course extends RootEntity {
	
	public static final String CODE_PREFIX = "COU-";	
	
	@Column(nullable = false)
	private String title;
	
	@Column
	private String description;
	
	@Column
	private String fileKey;
	
	@Column
	private Long lecturerID;
	
	@Column
	private String lecturerName;
	
	@Column @Enumerated(EnumType.STRING)
	private CourseStatus status;		
		
	/**
	 * The code identifier of the entity. 
	 */
	public String getCode() {
		return CODE_PREFIX + getId();
	}
	
	/**
	 * Returns the title.
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * Setter for the title.
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * Returns the description.
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Setter for the description.
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * Returns the status.
	 */
	public CourseStatus getStatus() {
		return status;
	}

	/**
	 * Setter for the status.
	 */
	public void setStatus(CourseStatus status) {
		this.status = status;
	}

	/**
	 * Returns the fileKey.
	 */
	public String getFileKey() {
		return fileKey;
	}

	/**
	 * Setter for the fileKey.
	 */
	public void setFileKey(String fileKey) {
		this.fileKey = fileKey;
	}

	/**
	 * Returns the lecturerID.
	 */
	public Long getLecturerID() {
		return lecturerID;
	}

	/**
	 * Setter for the lecturerID.
	 */
	public void setLecturerID(Long lecturerID) {
		this.lecturerID = lecturerID;
	}

	/**
	 * Returns the lecturerName.
	 */
	public String getLecturerName() {
		return lecturerName;
	}

	/**
	 * Setter for the lecturerName.
	 */
	public void setLecturerName(String lecturerName) {
		this.lecturerName = lecturerName;
	}
	
}